//
//  YQOrderManagePriceCell.swift
//  MuYing
//
//  Created by tbb on 2019/8/1.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class YQOrderManagePriceCell: YQTableViewBaseCell {

    @objc var orderModel = YQPOrderEntityModel()
    
    @objc var goodsOrdreModel:YQGoodsOrderModel? {
        didSet {
            
            self.totalMoneyLb.text = String(format: "共%zd件商品 合计: HKD %.2lf (免邮)", (goodsOrdreModel?.totalGoodsNum ?? 0),(goodsOrdreModel?.totalMoney ?? 0.00));
        }
    }

    @objc @IBOutlet weak var totalMoneyLb: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    @objc func setModel(_ model:YQPOrderEntityModel){
    //        let status = model.orderStatus
        self.orderModel = model
        var freStr = ""
        
        let freight:Double = Double(model.freight) ?? 0;//( as NSString).doubleValue
        if freight <= 0 {
            freStr = "(免邮)"
        } else {
            freStr = model.freight
        }
        self.totalMoneyLb.text = kYQLSSwift("共" + model.goodsNumber + "件商品 合计: HKD" + model.payIntegralAmount + freStr)
        
    }
}

